import "@babel/polyfill";
import Ground from './ground';
import Egg from './egg';
import Snake from './snake';

//场地参数
const groundWidth = 500;
const groundHeight = 500;
const groundBgColor = '#36E28A';
const cellCol = 100;
const cellRow = 100;
//蛋的参数
const eggColor = '#000';
//蛇的参数
const snakeHeadColor = 'red';
const snakeBodyColor = '#000';
const snakeBaseLength = 10;
//实例化场地
let ground = new Ground(groundWidth,groundHeight,groundBgColor,cellCol,cellRow);
//实例化鸡蛋
let egg = new Egg(eggColor);
//实例化蛇
let snake = new Snake(snakeHeadColor,snakeBodyColor,snakeBaseLength);
//初识化场地
ground.init();

snake.create(ground);
egg.create(ground,[]);

snake.run(egg);

